<template>
  <div id="index">
    <dv-full-screen-container class="bg">
      <dv-loading v-if="loading">Loading...</dv-loading>
      <div v-else class="host-body">
        <div class="d-flex jc-center">
          <dv-decoration-10 style="width:33.3%;height:.0625rem;" />
          <div class="d-flex jc-center">
            <dv-decoration-8 :color="['#568aea', '#000000']" style="width:2.5rem;height:.625rem;" />
            <div class="title">
              <span class="title-text">大数据可视化平台</span>
              <dv-decoration-6
                class="title-bototm"
                :reverse="true"
                :color="['#50e3c2', '#67a1e5']"
                style="width:3.125rem;height:.1rem;"
              />
            </div>
            <dv-decoration-8
              :reverse="true"
              :color="['#568aea', '#000000']"
              style="width:2.5rem;height:.625rem;"
            />
          </div>
          <dv-decoration-10 style="width:33.3%;height:.0625rem; transform: rotateY(180deg);" />
        </div>

        <!-- 第二行 -->
        <div class="d-flex jc-between px-2">
          <div class="d-flex" style="width: 40%">
            <!-- <router-link to="/index/cart_info1"> -->
            <div
              class="react-right ml-4"
              style="width: 6.25rem; text-align: left;"
              @click="goto('/index/cart_info2')"
            >
              <span class="react-before"></span>
              <span class="mutual_text text">整体舆情分析表</span>
            </div>
            <!-- </router-link> -->
            <!-- <router-link to="/index/cart_info2"> -->
            <div class="react-right ml-3" @click="goto('/index/cart_info3')">
              <span class="text mutual_text colorBlue">主题分类</span>
            </div>
            <!-- </router-link> -->
            <!-- <router-link to="/index/cart_info3"> -->
            <div class="react-right ml-3" @click="goto('/index/cart_info4')">
              <span class="text mutual_text colorBlue">关键词查询</span>
            </div>
            <!-- </router-link> -->
            <!-- <router-link to="/index/cart_info4"> -->
            <div class="react-right ml-3" @click="goto('/index/cart_info5')">
              <span class="text mutual_text colorBlue">舆情预警</span>
            </div>
            <!-- </router-link> -->
          </div>
          <div style="width: 40%" class="d-flex">
            <!-- <div class="icon-box bg-color-blue mr-3" @click="search_view()">
              <span class="text fw-b">
                <i class="el-icon-search"></i>
              </span>
            </div> -->
            <div class="react-left bg-color-blue mr-3" @click="quit()">
              <span class="text fw-b">退出系统</span>
            </div>
            <div class="react-left mr-4" style="width: 6.25rem;  text-align: right;">
              <span class="react-after"></span>
              <span class="text">{{formattedDate}}</span>
            </div>
          </div>
        </div>
        <div>
          <router-view></router-view>
        </div>
        <!-- <cart_info1 /> -->
      </div>
    </dv-full-screen-container>
  </div>
</template>

<script>
// import centerLeft1 from "./centerLeft1";
// import centerLeft2 from "./centerLeft2";
// import centerRight1 from "./centerRight1";
// import centerRight2 from "./centerRight2";
// import center from "./center";
// import bottomLeft from "./bottomLeft";
// import bottomRight from "./bottomRight";
// import cart_info1 from "./cart_info1";
export default {
  data() {
    return {
      loading: true,
      formattedDate: ""
    };
  },
  components: {
    // centerLeft1,
    // centerLeft2,
    // centerRight1,
    // centerRight2,
    // center,
    // bottomLeft,
    // bottomRight,
    // cart_info1
  },
  mounted() {
    this.timeinit();
    this.cancelLoading();
    this.cancelLoading();
  },
  methods: {
    cancelLoading() {
      setTimeout(() => {
        this.loading = false;
      }, 500);
    },
    quit() {
      this.$router.push("/login");
    },
    search_view() {
      this.$router.push("/search_view");
    },
    timeinit() {
      const currentDate = new Date();
      const year = currentDate.getFullYear();
      const month = currentDate.getMonth() + 1;
      const day = currentDate.getDate();

      const weekday = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
      const formattedDate = `${year}年${month}月${day}日 ${
        weekday[currentDate.getDay()]
      } ${currentDate.getHours()}时${currentDate.getMinutes()}分`;
      this.formattedDate = formattedDate;
    },
    goto(path) {
      console.log("即将跳转"),
        //这一步是为了验证是否跳转成功，如果成功就会打印，否则出错
        this.$router.push(path);
      //这一步就是跳转语句，path是形参,在template里面应该写一个实参传参数引进来
    }
  }
};
</script>

<style lang="scss">
@import "../assets/scss/index.scss";
</style>